/*********************************************************
 ** Author: Sandtanglo Toyer
 **
 ** Description: This class will handle the core aspects
 ** of the application. It will create the Window, Direct
 ** 3D Device and Object.
 *********************************************************/
#ifndef DX_APP_H
#define DX_APP_H

//Include files
#include "GfxStats.h"
#include "ScreenManager.h"
#include "Input.h"
#include "cAudio.h"

class Application {
	public:
		////////////////////////////////////////
		// Functional Information for the class
		////////////////////////////////////////

		//Constructor
		Application(HINSTANCE hInstance, int nCmdShow, D3DDEVTYPE devType, DWORD requestedVP);

		//Destructor
		~Application();

		//Accessors for the Variables
		HWND		getMainhWnd();
		HINSTANCE	getMainInstance();

		//Initialization of the Window
		bool initWindow(int nCmdShow);

		//Initialization of the DirectX SDK
		bool initDirectX();

		//Changes the screen setting
		void enableFullScreen(bool bIsWindowed);

		//Run Message Loop
		int Run();

		//Returns the instance of the Fullscreen Mode
		bool getWindowed();
		void setWindowed(bool bIsWindowed);

		//Performs a check to see if the 
		bool isDeviceLost();

		//Shutdown Function to Release Objects
		void Shutdown();

		//Rendering and Update Functions
		virtual void renderScene(){}
		virtual void updateScene(float dt){}

		//Recover information pertaining to the creation of the window device
		virtual void onLostDevice(){}
		virtual void onResetDevice(){}
		
	private:
		/////////////////////////////////////
		//
		/////////////////////////////////////

		//Window Name
		//string					m_winCaption;
		
		//Screen Resolution and Screen check
		bool					m_bIsWindowed;
		unsigned int			m_ScreenWidth;
		unsigned int			m_ScreenHeight;

		//Windows data members for the class
		HWND					hMainhWnd;						
		HINSTANCE				hMainhInstance;

		//DirectX data members for the class
		IDirect3D9				*m_pD3DObject;

		D3DDEVTYPE				m_DevType;
		DWORD					m_RequestVP;
		D3DCAPS9				m_Caps;
		D3DPRESENT_PARAMETERS	m_D3Dpp;

	protected:
		//Functionality of the Screen manager and screen object for rendering graphics
		ScreenManager			*m_Manager;
		cScreen					*m_pCurrentScreen;
};

#endif